home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIConverterOutputStream.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  120 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIConverterOutputStream.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIConverterOutputStream_h__
  6. #define __gen_nsIConverterOutputStream_h__
  7.  
  8.  
  9. #ifndef __gen_nsIUnicharOutputStream_h__
  10. #include "nsIUnicharOutputStream.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIOutputStream; /* forward declaration */
  18.  
  19.  
  20. /* starting interface:    nsIConverterOutputStream */
  21. #define NS_ICONVERTEROUTPUTSTREAM_IID_STR "4b71113a-cb0d-479f-8ed5-01daeba2e8d4"
  22.  
  23. #define NS_ICONVERTEROUTPUTSTREAM_IID \
  24.   {0x4b71113a, 0xcb0d, 0x479f, \
  25.     { 0x8e, 0xd5, 0x01, 0xda, 0xeb, 0xa2, 0xe8, 0xd4 }}
  26.  
  27. /**
  28.  * This interface allows writing strings to a stream, doing automatic
  29.  * character encoding conversion.
  30.  */
  31. class NS_NO_VTABLE nsIConverterOutputStream : public nsIUnicharOutputStream {
  32.  public: 
  33.  
  34.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONVERTEROUTPUTSTREAM_IID)
  35.  
  36.   /**
  37.      * Initialize this stream. Must be called before any other method on this
  38.      * interface, or you will crash. The output stream passed to this method
  39.      * must not be null, or you will crash.
  40.      *
  41.      * @param aOutStream
  42.      *        The underlying output stream to which the converted strings will
  43.      *        be written.
  44.      * @param aCharset
  45.      *        The character set to use for encoding the characters. A null
  46.      *        charset will be interpreted as UTF-8.
  47.      * @param aBufferSize
  48.      *        How many bytes to buffer. A value of 0 means that no bytes will be
  49.      *        buffered. Implementations not supporting buffering may ignore
  50.      *        this parameter.
  51.      * @param aReplacementCharacter
  52.      *        The replacement character to use when an unsupported character is found.
  53.      *        The character must be encodable in the selected character
  54.      *        encoding; otherwise, attempts to write an unsupported character
  55.      *        will throw NS_ERROR_LOSS_OF_SIGNIFICANT_DATA.
  56.      *
  57.      *        A value of 0x0000 will cause an exception to be thrown upon
  58.      *        attempts to write unsupported characters.
  59.      */
  60.   /* void init (in nsIOutputStream aOutStream, in string aCharset, in unsigned long aBufferSize, in PRUnichar aReplacementCharacter); */
  61.   NS_IMETHOD Init(nsIOutputStream *aOutStream, const char *aCharset, PRUint32 aBufferSize, PRUnichar aReplacementCharacter) = 0;
  62.  
  63. };
  64.  
  65. /* Use this macro when declaring classes that implement this interface. */
  66. #define NS_DECL_NSICONVERTEROUTPUTSTREAM \
  67.   NS_IMETHOD Init(nsIOutputStream *aOutStream, const char *aCharset, PRUint32 aBufferSize, PRUnichar aReplacementCharacter); 
  68.  
  69. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  70. #define NS_FORWARD_NSICONVERTEROUTPUTSTREAM(_to) \
  71.   NS_IMETHOD Init(nsIOutputStream *aOutStream, const char *aCharset, PRUint32 aBufferSize, PRUnichar aReplacementCharacter) { return _to Init(aOutStream, aCharset, aBufferSize, aReplacementCharacter); } 
  72.  
  73. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  74. #define NS_FORWARD_SAFE_NSICONVERTEROUTPUTSTREAM(_to) \
  75.   NS_IMETHOD Init(nsIOutputStream *aOutStream, const char *aCharset, PRUint32 aBufferSize, PRUnichar aReplacementCharacter) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aOutStream, aCharset, aBufferSize, aReplacementCharacter); } 
  76.  
  77. #if 0
  78. /* Use the code below as a template for the implementation class for this interface. */
  79.  
  80. /* Header file */
  81. class nsConverterOutputStream : public nsIConverterOutputStream
  82. {
  83. public:
  84.   NS_DECL_ISUPPORTS
  85.   NS_DECL_NSICONVERTEROUTPUTSTREAM
  86.  
  87.   nsConverterOutputStream();
  88.  
  89. private:
  90.   ~nsConverterOutputStream();
  91.  
  92. protected:
  93.   /* additional members */
  94. };
  95.  
  96. /* Implementation file */
  97. NS_IMPL_ISUPPORTS1(nsConverterOutputStream, nsIConverterOutputStream)
  98.  
  99. nsConverterOutputStream::nsConverterOutputStream()
  100. {
  101.   /* member initializers and constructor code */
  102. }
  103.  
  104. nsConverterOutputStream::~nsConverterOutputStream()
  105. {
  106.   /* destructor code */
  107. }
  108.  
  109. /* void init (in nsIOutputStream aOutStream, in string aCharset, in unsigned long aBufferSize, in PRUnichar aReplacementCharacter); */
  110. NS_IMETHODIMP nsConverterOutputStream::Init(nsIOutputStream *aOutStream, const char *aCharset, PRUint32 aBufferSize, PRUnichar aReplacementCharacter)
  111. {
  112.     return NS_ERROR_NOT_IMPLEMENTED;
  113. }
  114.  
  115. /* End of implementation class template. */
  116. #endif
  117.  
  118.  
  119. #endif /* __gen_nsIConverterOutputStream_h__ */
  120.